<?php
 include 'product_model.php';
  $Categoryid=$_GET['ID_category'];
  $arr_pro=array();
  $arr_pro= getProduct($Categoryid);
  $tendanhmuc=array();
  $tendanhmuc= getCategoryName($Categoryid);
  if($arr_pro!=NULL && $tendanhmuc!=NULL)
  {
  echo '<table width="900px" class="table">';
  echo '<tr align="center">';
  echo "<td colspan='8'><b>PRODUCT LIST --<font color='red'>".$tendanhmuc[6]."</font>-- </b></td>";
  echo '</tr>';
  echo '<tr>';
  echo '<td><b>ID</b></td>';
  echo '<td><b>Tên sản phẩm</b></td>';
  echo '<td><b>Mô tả</b></td>';
  echo '<td><b>Giá</b></td>';
  echo '<td><b>Size</b></td>';
  echo '<td><b>Image</b></td>';
  echo '<td><b>Xoá</b></td>';
   echo '<td><b>Sửa</b></td>';
  echo '</tr>';
  echo '<tr>';
      foreach ($arr_pro as $product) {
          echo "<td>".$product[0]."</td>";
          echo "<td>".$product[1]."</td>";
          echo "<td>".$product[2]."</td>";
          echo "<td>".$product[3]."</td>";
          echo "<td>".$product[4]."</td>";
          echo '<td> <img width="133px" height="160px" src="'.$product[5].'" /></td>';
  echo '<td align="center"><a href="v_productEdit.php?IDProduct='.$product[0].'"><img src="../images/1352648277_message_edit.png" width="30px" height="30px" /></a></td>';
  echo '<td align="center"><a href="c_addNewProduct.php?IDProduct='.$product[0].'"><img src="../images/1318498996_DeleteRed.ico" width="30px" height="30px"  /></a></td>';
  echo '</tr>'; 
   }
  }
   else
       echo 'Chưa có sản phẩm nào, vui lòng thêm sản phẩm!!';

?>
